<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=                            , initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f0f0f0;
        }
        .container {
            position: relative;
            text-align: center;
        }
        #productContainer {
            position: relative;
            max-width: 80%;
            margin-bottom: 20px;
        }
        #productImage {
            width: 100%;
            height: auto;
        }
        #countdownOverlay {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            background-color: rgba(255, 255, 255, 0.8);
            padding: 10px 0;
        }
        .countdown-box {
            display: inline-block;
            margin: 0 5px;
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: 5px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div id="productContainer">
            <img id="productImage" src="flash_sale.png" alt="秒杀商品">
            <div id="countdownOverlay">
                <span class="countdown-box" id="days">00</span>天
                <span class="countdown-box" id="hours">00</span>时
                <span class="countdown-box" id="minutes">00</span>分
                <span class="countdown-box" id="seconds">00</span>秒
            </div>
        </div>
    </div>

    <script>
        const seckillTime = 10 * 60 * 1000;
        let remainingTime = seckillTime;
        function updateCountdown() {
            const days = Math.floor(remainingTime / (1000 * 60 * 60 * 24));
            const hours = Math.floor((remainingTime % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
            const minutes = Math.floor((remainingTime % (1000 * 60 * 60)) / (1000 * 60));
            const seconds = Math.floor((remainingTime % (1000 * 60)) / 1000);

            document.getElementById('days').innerText = formatTime(days);
            document.getElementById('hours').innerText = formatTime(hours);
            document.getElementById('minutes').innerText = formatTime(minutes);
            document.getElementById('seconds').innerText = formatTime(seconds);
        }
        function formatTime(time) {
            return time < 10 ? `0${time}` : time;
        }
        function countdown() {
            if (remainingTime <= 0) {
                clearInterval(timer);
                document.getElementById('countdownOverlay').innerHTML = '秒杀已结束';
            } else {
                remainingTime -= 1000; 
                updateCountdown();
            }
        }
        const timer = setInterval(countdown, 1000);
    </script>
</body>
</html>